<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="@{include} :: header"></head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-row">
            <form class="layui-form layui-form-pane" id="signupForm">
                <input id="id" name="id" th:value="${device.id}" type="hidden" />
<!--                <input type="hidden" id="deviceType" name="deviceType" th:value="${device.deviceType}" />-->
<!--                <input id="shopId" name="shopId" th:value="${device.shopId}" type="hidden" />-->

                <div class="layui-form-item" >
                    <label class="layui-form-label">所属企业</label>
                    <div class="layui-input-block">
                        <select name="shopId" id="shopId" lay-search="">
                            <option value="">所属企业</option>
                            <th:block th:each="d : ${shops}">
                                <option th:value="${d.id}" th:text="${d.shopName}" th:selected="${device.shopId == d.id}"></option>
                            </th:block>
                        </select>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">设备名称</label>
                    <div class="layui-input-block">
                        <input id="deviceName" name="deviceName" th:value="${device.deviceName}" class="layui-input" type="text">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">设备编码</label>
                    <div class="layui-input-block">
                        <input id="deviceNum" name="deviceNum" th:value="${device.deviceNum}" class="layui-input" type="text" />
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">设备类型</label>
                    <div class="layui-input-block">
                        <select name="deviceType" id="deviceType">
                            <option value="">请选择设备类型</option>
                            <option value="0" th:selected="${device.deviceType == 0}">粮仓测量设备</option>
                            <option value="1" th:selected="${device.deviceType == 1}">油罐测量设备</option>
                        </select>
                    </div>
                </div>

                <div class="layui-form-item" th:if="${device.deviceType == 0}">
                    <label class="layui-form-label">最大测量角度</label>
                    <div class="layui-input-block">
                        <input id="maxAngle" style="width: 72%;float: left;" name="maxAngle" th:value="${device.maxAngle}" class="layui-input" type="number" />
                        <label class="layui-form-label">度</label>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">立卧类型</label>
                    <div class="layui-input-block">
                        <select name="isLie" id="isLie">
                            <option value="">请选择立卧类型</option>
                            <option value="0" th:selected="${device.isLie == 0}">立式</option>
                            <option value="1" th:selected="${device.isLie == 1}">卧式</option>
                        </select>
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">筒仓形状</label>
                    <div class="layui-input-block">
                        <select name="isEllipse" id="isEllipse" lay-filter="isEllipse">
                            <option value="">请选择筒仓形状</option>
                            <option value="0" th:selected="${device.isEllipse == 0}">正圆</option>
                            <option value="1" th:selected="${device.isEllipse == 1}">椭圆</option>
                            <option value="2" th:selected="${device.isEllipse == 2}">柱体</option>
                        </select>
                    </div>
                </div>

                <div class="layui-form-item" id="storeDiv" th:classappend="${device.isEllipse eq 0}  ? '' : 'layui-hide'">
                    <label class="layui-form-label">正圆直径</label>
                    <div class="layui-input-block">
                        <input id="storeDiameter" style="width: 72%;float: left;" name="storeDiameter" th:value="${device.storeDiameter}" class="layui-input" type="number" />
                        <label class="layui-form-label">米</label>
                    </div>
                </div>

                <div id="ellipseDiv" th:classappend="${device.isEllipse eq 1}  ? '' : 'layui-hide'">
                    <div class="layui-form-item" >
                        <label class="layui-form-label">椭圆长半轴</label>
                        <div class="layui-input-block" >
                            <input id="longHalfShaft" style="width: 72%;float: left;" name="longHalfShaft" th:value="${device.longHalfShaft}" class="layui-input" type="number" />
                            <label class="layui-form-label">米</label>
                        </div>
                    </div>
                    <div class="layui-form-item" >
                        <label class="layui-form-label">椭圆短半轴</label>
                        <div class="layui-input-block">
                            <input id="shortHalfShaft" style="width: 72%;float: left;" name="shortHalfShaft" th:value="${device.shortHalfShaft}" class="layui-input" type="number" />
                            <label class="layui-form-label">米</label>
                        </div>
                    </div>
                </div>

                <div id="rectDiv" th:classappend="${device.isEllipse eq 2}  ? '' : 'layui-hide'">
                    <div class="layui-form-item" >
                        <label class="layui-form-label">四边形柱体长度</label>
                        <div class="layui-input-block">
                            <input id="rectLength" style="width: 72%;float: left;" name="rectLength" th:value="${device.rectLength}" class="layui-input" type="number" />
                            <label class="layui-form-label">米</label>
                        </div>
                    </div>
                    <div class="layui-form-item" >
                        <label class="layui-form-label">四边形柱体宽度</label>
                        <div class="layui-input-block" >
                            <input id="rectWidth" style="width: 72%;float: left;" name="rectWidth" th:value="${device.rectWidth}" class="layui-input" type="number" />
                            <label class="layui-form-label">米</label>
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">柱体高度</label>
                    <div class="layui-input-block">
                        <input id="cylinderHeight" style="width: 72%;float: left;" name="cylinderHeight" th:value="${device.cylinderHeight}" class="layui-input" type="number" />
                        <label class="layui-form-label">米</label>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">下方锥体高度</label>
                    <div class="layui-input-block">
                        <input id="coneHeight" style="width: 72%;float: left;" name="coneHeight" th:value="${device.coneHeight}" class="layui-input" type="number" />
                        <label class="layui-form-label">米</label>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">最大量程</label>
                    <div class="layui-input-block">
                        <input id="maxRange" style="width: 72%;float: left;" name="maxRange" th:value="${device.maxRange}" class="layui-input" type="number" />
                        <label class="layui-form-label">米</label>
                    </div>
                </div>

                <div class="layui-form-item" >
                    <label class="layui-form-label">当前容重</label>
                    <div class="layui-input-block">
                        <input id="plotRatio" style="width: 72%;float: left;" name="plotRatio" th:value="${device.plotRatio}" class="layui-input" type="number" />
                        <label class="layui-form-label">Kg/立方米</label>
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">强制空仓</label>
                    <div class="layui-input-block">
                        <select name="isEmpty" id="isEmpty">
                            <option value="">请选择是否强制空仓</option>
                            <option value="0" th:selected="${device.isEmpty == 0}">去掉强制空仓</option>
                            <option value="1" th:selected="${device.isEmpty == 1}">强制空仓</option>
                        </select>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">空仓显示数据</label>
                    <div class="layui-input-block">
                        <select name="isShowEmpty" id="isShowEmpty">
                            <option value="">请选择空仓是否显示数据</option>
                            <option value="0" th:selected="${device.isShowEmpty == 0}">显示数值</option>
                            <option value="1" th:selected="${device.isShowEmpty == 1}">显示空仓</option>
                        </select>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">满仓显示数据</label>
                    <div class="layui-input-block">
                        <select name="isShowFull" id="isShowFull">
                            <option value="">请选择满仓是否显示数据</option>
                            <option value="0" th:selected="${device.isShowFull == 0}">显示数值</option>
                            <option value="1" th:selected="${device.isShowFull == 1}">显示满仓</option>
                        </select>
                    </div>
                </div>

                <div class="layui-form-item" >
                    <label class="layui-form-label">误差修正长度</label>
                    <div class="layui-input-block">
                        <input id="errorHeight" style="width: 72%;float: left;" name="errorHeight" th:value="${device.errorHeight}" class="layui-input" type="number" />
                        <label class="layui-form-label">厘米</label>
                    </div>
                </div>
                <div class="layui-form-item" th:if="${device.deviceType == 0}">
                    <label class="layui-form-label">是否显示新算法</label>
                    <div class="layui-input-block">
                        <select name="isShowNewResult" id="isShowNewResult">
                            <option value="">请选择</option>
                            <option value="0" th:selected="${device.isShowNewResult == 0}">显示旧算法</option>
                            <option value="1" th:selected="${device.isShowNewResult == 1}">显示新算法</option>
                        </select>
                    </div>
                </div>
                <!--                <div class="layui-form-item">-->
<!--                    <label class="layui-form-label">圆锥总体积</label>-->
<!--                    <div class="layui-input-block">-->
<!--                        <input id="maxConeVolume" style="width: 72%;float: left;" name="maxConeVolume" th:value="${device.maxConeVolume}" class="layui-input" type="number" />-->
<!--                        <label class="layui-form-label">立方米</label>-->
<!--                    </div>-->
<!--                </div>-->

<!--                <div class="layui-form-item">-->
<!--                    <label class="layui-form-label">圆柱总体积</label>-->
<!--                    <div class="layui-input-block">-->
<!--                        <input id="maxCylinderVolume" style="width: 72%;float: left;" name="maxCylinderVolume" th:value="${device.maxCylinderVolume}" class="layui-input" type="number" />-->
<!--                        <label class="layui-form-label">立方米</label>-->
<!--                    </div>-->
<!--                </div>-->

                <div class="layui-form-item">
                    <div style="text-align: center;margin-top: 20px">
                        <button  onclick="update()" class="layui-btn layui-btn-normal" >提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" th:src="@{/js/appjs/module/device/range/detail.js}"></script>
</body>
</html>
